using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;

namespace My.IdlConverter.Core.Parsers
{
    public class ClassPreprocessor : InterfacePreprocessor
    {
        public readonly static string ProtectedMethodRegex = @"protected:.*";
        public readonly static string PrivateMethodRegex = @"private:.*";
        public readonly static string DtorRegex = @"virtual.*~.*";
        public static readonly string ExcludePartRegex = @"//exclude.*//exclude";

        public ClassPreprocessor()
        {
        }

        public ClassPreprocessor(string consumer)
            :base(consumer)
        {
        }

        public override string Process()
        {
            string processedContent = base.Process();

            DeleteContent(DtorRegex, RegexOptions.Multiline, ref processedContent);
            DeleteContent(ProtectedMethodRegex, RegexOptions.Singleline, ref processedContent);
            DeleteContent(PrivateMethodRegex, RegexOptions.Singleline, ref processedContent);
            DeleteContent(ExcludePartRegex, RegexOptions.Singleline, ref processedContent);

            return processedContent;
        }
    }
}
